home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-14 | 2.7 KB | 83 lines | [TEXT/MPS ] |
- /* _________________________________________________________________________________________________________ //
- Copyright © 1992-93 Apple Computer, Inc. All rights reserved.
- Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
- Date: 11/7/92
- Revision comments are at the end of this file.
- ---
- TWindow is a Window wrapper class that handles most of the basic window functionality.
- Window.h contains the TWindow class definition.
- _________________________________________________________________________________________________________ */
-
- // Declare label for this header file
- #ifndef _WINDOW_
- #define _WINDOW_
-
- #ifndef _DTSCPLUSLIBRARY_
- #include "DTSCPlusLibrary.h"
- #endif
-
- #ifndef __WINDOWS__
- #include <Windows.h>
- #endif
-
- #ifndef _ENVIRONMENT_
- #include "Environment.h"
- #endif
-
-
- // _________________________________________________________________________________________________________ //
- // TWindow Class Interface.
- class TWindow
- // TWindow is a simple Window class that could be used to produce simple window objects.
- {
- public:
- // TYPEDEFS AND ENUMS
- enum ECoordinates // used to define the default window size/position
- {
- kTop = 50, kLeft = 50, kBottom = 275, kRight = 275
- };
-
- // CONSTRUCTORS AND DESTRUCTORS
- TWindow(); // default constructor
- TWindow(short windowID); // create a window based on a resource ID
- virtual~ TWindow(); // default destructor
-
- virtual void Initialize(); // initialize fields to known values
-
- // MAIN INTERFACE
- virtual void Draw(); // the main drawing routine
- virtual void DoClick(); // handle mouse clicks inside window
- virtual void Show(); // show window
- virtual void Hide(); // hide window
-
- // GET/SET FUNCTIONS
- virtual WindowPtr GetWindowPtr() const; // get the object's WindowPtr
- virtual void SetTitle(const Str255* title); // set window title
- virtual void GetTitle(Str255* result) const;// get window title
- virtual Rect GetExtent() const; // get window interior rect
- virtual Rect GetFrame() const; // get window frame rect
- virtual Boolean Contains(Point test) const; // test if point is inside window
- virtual Boolean IsColorWindow() const; // color window or not?
-
- // FIELDS
- protected:
- WindowPtr fWindow; // our single WindowPtr
- WindowPeek fWindowRecord; // pointer to the window record
- Str255 fWindowTitle; // out window title
- Rect fRect; // the rect for the window
- Boolean fColorWindow; // enabled if the window supports Color QD
- };
-
-
- #endif
-
- // _________________________________________________________________________________________________________ //
-
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 11/7/92 New file
- 2 khs 1/7/93 Cleanup
- */
-
-